package cn.mesmile.forest.controller;

import cn.mesmile.forest.service.ClientService;
import jdk.nashorn.internal.scripts.JS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zb
 * @date 2022/1/12 17:07
 * @Description
 */
@RequestMapping("/api")
@RestController
public class ForestController {

    @Autowired
    private ClientService clientService;

    @GetMapping("/hello")
    public String hello(){
        return "hello world";
    }

    @GetMapping("/test")
    public Map<String, Object> test(){
        String hello = clientService.hello();
        Map<String, Object> map = new HashMap<>();
        map.put("data",hello);
        map.put("code", 200);
        map.put("success", true);
        return map;
    }


}
